using System;
using System.Data;
using System.Collections.Generic;
using System.Collections;
using log4net;
using WEB.BLL.Entities;
using WEB.Exceptions;
namespace WEB.BLL.Services
{
    #region ExpertiseProjectService

    /// <summary>
    /// DesktopService object for Ibatis mapped table 'Desktop'.
    /// </summary>
    public class ExpertiseProjectService : IExpertiseProjectService
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(ExpertiseProjectService).Name);
        private static volatile ExpertiseProjectService _ExpertiseProjectService = null;
        public static ExpertiseProjectService GetInstance()
        {
            if (_ExpertiseProjectService == null)
            {
                lock (typeof(ExpertiseProjectService))
                {
                    if (_ExpertiseProjectService == null) // double-check
                        _ExpertiseProjectService = new ExpertiseProjectService();
                }
            }
            return _ExpertiseProjectService;
        }
        public ExpertiseProjectService()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public IList<ExpertiseProjectEntity> LoadByProjectId(ExpertiseProjectEntity objE)
        {
            try
            {
                return ExecuteQueryForList<ExpertiseProjectEntity>("ExpertiseProjectLoadByProjectId", objE);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
        public int InsertEX(ExpertiseProjectEntity objE)
        {
            try
            {
                ExecuteInsert("ExpertiseProjectInsertEX", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
        public int DeleteByProjectId(ExpertiseProjectEntity objE)
        {
            try
            {
                ExecuteDelete("ExpertiseProjectDeleteByProjectId", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                throw new DBException(ex.Message, ex);
            }
        }
    }
    #endregion
}
